package com.ghy.nba.services;

import com.ghy.nba.dao.PowerRepository;
import com.ghy.nba.entities.Power;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PowerService {

    @Autowired
    PowerRepository powerRepository;

    public Power save(Power power){return powerRepository.save(power);}
    public List<Power> getAll(){return powerRepository.findAll();}

    public Power findByPowerId(long theId){

        return powerRepository.findByPowerId(theId);
    }

    public void delete(Power thePower){
        powerRepository.delete(thePower);
    }


}


